﻿<Page x:Class="WpfWalkthrough.ExpenseReportPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="302" d:DesignWidth="470"
	Title="ExpenseIt - View Expense">
    <Grid Margin="10,10,10,10">
        <Grid.Background>
            <ImageBrush ImageSource="watermark.png"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="230"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Label Grid.Row="0" Grid.Column="1" Style="{StaticResource headerTextStyle}">Expense Report For:
        </Label>
        <Grid Margin="10" Grid.Row="1" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
                <Label Style="{StaticResource labelStyle}">Name:</Label>
                <Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Name}"></Label>
            </StackPanel>
            <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
                <Label Style="{StaticResource labelStyle}">Department:</Label>
                <Label Style="{StaticResource labelStyle}" Content="{Binding XPath=@Department}"></Label>
            </StackPanel>
            <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                <Grid.Resources>
                    <DataTemplate x:Key="typeItemTemplate">
                        <Label Content="{Binding XPath=@ExpenseType}"/>
                    </DataTemplate>
                    <DataTemplate x:Key="amountItemTemplate">
                        <Label Content="{Binding XPath=@ExpenseAmount}"/>
                    </DataTemplate>
                </Grid.Resources>
                <DataGrid Grid.Row="0" Grid.Column="0" ItemsSource="{Binding XPath=Expense}" AutoGenerateColumns="False" RowHeaderWidth="0" ColumnHeaderStyle="{StaticResource columnHeaderStyle}">
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="ExpenseType" Binding="{Binding XPath=@ExpenseType}"/>
                        <DataGridTextColumn Header="Amount" Binding="{Binding XPath=@ExpenseAmount}"/>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </Grid>
    </Grid>
</Page>
